<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<script type="text/javascript" src="${pageContext.request.contextPath }/js/jquery-1.4.1.min.js"></script>
		<script type="text/javascript">
			$(function(){
				$("#username").blur(function(){
					$.post("${pageContext.request.contextPath}/ajax/validateUsername",
						   {"username":$(this).val()},
						   function(message){
							   $("#usernameMessage").text(message);
						   });
				});
				
				$("#show").click(function(){
					$.getJSON("${pageContext.request.contextPath}/ajax/getEmp",
							  function(emp){
								$("#id").text(emp.id);
								$("#name").text(emp.name);
								$("#password").text(emp.password);
								$("#email").text(emp.email);
							  });
					
				});
				
			});
		</script>
	</head>
	<body>
		用户名：<input id="username" type="text" name="username"/>
			  <span id="usernameMessage"></span>
			  
		<hr/>
		
		<a href="javascript:;" id="show">显示数据</a>
		<hr/>
		编号：<span id="id"></span><br/>
		姓名：<span id="name"></span><br/>
		密码：<span id="password"></span><br/>
		邮箱：<span id="email"></span><br/>
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
	</body>
</html>
